package edu.uoc.tdp.pac4.client;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.Font;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.border.EmptyBorder;
import javax.swing.table.DefaultTableModel;

import edu.uoc.tdp.pac4.common.EstudianteInterface;
import edu.uoc.tdp.pac4.common.TDSLanguageUtils;

import java.awt.GridLayout;
import java.awt.FlowLayout;

/**  
 * Pantalla de consulta de lista de pruebas disponibles
 * Universitat Oberta de Catalunya (UOC)
 * @author SoftWebSolutions  
 * @version 1.0
 * 
 */
public class PantallaConsultaProves extends JFrame {

	private JPanel contentPane;
	private JFrame frame;
	private JTable table;
	private EstudianteInterface remoto;

	/**
	 * Launch the application.
	 */
	/*
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					PantallaConsultaProves frame = new PantallaConsultaProves(remoto);
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}
*/
	/**
	 * Create the frame.
	 */
	public PantallaConsultaProves(EstudianteInterface rem) throws Exception {
		
		remoto = rem;
		
		frame = new JFrame();
		frame.setBounds(100, 100, 850, 434);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		JPanel panel = new JPanel();
		frame.getContentPane().add(panel, BorderLayout.CENTER);
		panel.setLayout(null);
		
		
		JPanel panel_2 = new JPanel();
		panel_2.setBackground(Color.WHITE);
		panel_2.setBounds(0, 0, 834, 76);
		panel.add(panel_2);
		panel_2.setLayout(null);
		
		JLabel label_2 = new JLabel("eOlympics");
		label_2.setForeground(new Color(51, 153, 255));
		label_2.setFont(new Font("Calibri", Font.BOLD, 26));
		label_2.setBounds(382, 28, 177, 26);
		panel_2.add(label_2);
		
		JLabel lblNewLabel = new JLabel("");
		lblNewLabel.setIcon(new ImageIcon(PantallaConsultaProves.class.getResource("/images/logo.png")));
		lblNewLabel.setBounds(263, 0, 118, 70);
		panel_2.add(lblNewLabel);
		
		JLabel lblNewLabel_1 = new JLabel("");
		lblNewLabel_1.setBounds(0, 368, 27, 14);
		panel.add(lblNewLabel_1);
		lblNewLabel_1.setIcon(new ImageIcon(PantallaConsultaProves.class.getResource("/images/logo_empresa.png")));
		
		JLabel lblBySoftwebsolutions = new JLabel("by SoftWebSolutions");
		lblBySoftwebsolutions.setBounds(32, 371, 84, 14);
		panel.add(lblBySoftwebsolutions);
		lblBySoftwebsolutions.setFont(new Font("Calibri", Font.PLAIN, 9));
		
		JScrollPane pane = new JScrollPane();
		pane.setBounds(0, 87, 834, 239);
		panel.add(pane);
		table = new JTable(new DefaultTableModel(
			new Object[][] {
				{"Prueba 1", "Final", "10", "25", "12", "30/08/2013", true},
			},
			new String[] {
				"Test", "Type", "Questions", "Max. places", "Free places", "Date limit", "Registered"
			}
		) {
			Class[] columnTypes = new Class[] {
				Object.class, Object.class, Object.class, Object.class, Object.class, Object.class, Boolean.class
			};
			public Class getColumnClass(int columnIndex) {
				return columnTypes[columnIndex];
			}
		});
		pane.setViewportView(table);
		
		JButton btnNewButton_1 = new JButton(TDSLanguageUtils.getMessage("PantallaConsPr.boton.verPruebas"));
		btnNewButton_1.setIcon(new ImageIcon(PantallaConsultaProves.class.getResource("/images/document_text.png")));
		btnNewButton_1.setBounds(688, 337, 136, 45);
		panel.add(btnNewButton_1);
		//setSize(new Dimension(750, 550));
		
	}

}
